<%@page import="com.xxb.entity.Order"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.xxb.entity.CartItem"%>
<%@page import="com.xxb.entity.User"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>达芙妮官方购物网-订单确认</title>
		<link type="text/css" rel="stylesheet" href="style/ordercheckcss.css"/>
		<script type="text/javascript">
		
		function submitform() {
			var f = document.getElementById("checkorderform");
			f.submit();
		}
		</script>
	</head>
	<body>
		<div id="header">
			<div class="logo"></div>
				<div class="login"> 
						<%
						User user = (User)session.getAttribute("curruser");
					 	if(user == null){
					 %> 
					<a href="main.jsp">您好，欢迎观临达芙妮官方购物网</a>&nbsp;&nbsp; 
	           		<a href="l_to_login.jsp">登陆</a> 
	                |
					<a href="l_to_reg.jsp">注册</a>
	           		<%}else{ %>
	           		<a href="main.jsp">您好，<%=user.getName() %></a>&nbsp;&nbsp;
	           		<a href="l_exit.jsp" >退出</a> 
	                |
					<a href="l_member.jsp" >会员管理平台</a>
	           		<%} %> 
				</div>
			<div class="menu">
				<ul>
                    <li class="a" style="width:111px;"><a href="main.jsp">首页</a></li>
                    <li class="b" style="width:95px;"><a href="#">新品</a></li>
                    <li class="c" style="width:119px;"><a href="#">凉鞋</a></li>
                    <li class="d" style="width:95px;"><a href="danxie.jsp">单鞋</a></li>
                    <li class="e" style="width:95px;"><a href="#">靴子</a></li>
                    <li class="f" style="width:119px;"><a href="#">包.饰品</a></li>
                    <li class="g" style="width:119px;"><a href="#">特价专区</a></li>
				</ul>
                <div class="cart">
                        购物车（1）
                    <a href="cart.jsp" style="text-decoration:none"><input type="button" value="去结算" style="cursor:pointer"/></a>
                </div>
			</div>
			<div class="search">
                <div class="hottag" style="margin-top: 0px; margin-bottom: 0px;width: 480px;">
                    热门分类：&nbsp;
                    <a href="#">单鞋</a>&nbsp;|&nbsp;
                    <a href="#">高跟鞋</a>&nbsp;|&nbsp;
                    <a href="#">鱼嘴</a>&nbsp;|&nbsp;
                    <a href="#">平底</a>&nbsp;|&nbsp;
                    <a href="#">坡跟</a>&nbsp;|&nbsp;
                    <a href="#">真皮</a>
                </div>     
                <div class="searchinput">
                    <input type="text" class="search-area"/>
                    <input type="button" class="search-button"/>
                </div>	
			</div>
		</div>
		<div id="content">
			<div class="current">
				当前位置：
				<a href="main.jsp">首页</a> > 购物车
			</div>
			<div class="pic">
				<p class="step2">1.加入购物车》2.编辑订单》3.确认订单》4.订单成功</p>
				<p class="explain">
				<img src="images/title3.gif"/>
				</p>
			</div>
			<form id="checkorderform" method="post" action="l_to_ordersuc.jsp">
			<div id="order">
				<%
					Order order = (Order)request.getAttribute("order");
				 
			 	%>
				<p>收货人信息：</p>
					<span class="sp"><%=order.getAddress() %>（收货人：<%=order.getName() %>）</span>
				<p class="line" style="margin:0 15px"></p>
				<p>付款信息：</p>
					<img src="images/logo_zhifubao.jpg"/>
					<span class="sp">电话：<%=order.getPhone() %></span>
					
				<p class="line" style="margin:0 15px"></p>
				<p>选择送货方式：</p>
					<img src="images/logo_kd.jpg"/>
				<p class="line" style="margin:0 15px"></p>
				<p>订单备注：</p>
				<input type="hidden" value="<%=order.getId() %>" name="oid"/>
			</div>
			<p style="margin-top:30px;margin-bottom:0px;"><img src="images/title2_2.gif"/></p>
			<div id="checkorder">
				<table>
					<tr id="c1">
						<th>缩略图</th>
						<th style="width:375px;height:18px">商品名</th>
						<th style="width:110px;height:18px;">货号</th>
						<th style="width:50px">尺码</th>
						<th style="width:50px">颜色</th>
						<th style="width:70px">单价</th>
						<th style="width:50px">数量</th>
						<th style="width:110px">小计</th>
					</tr>
					
					 <% 
					 		List<CartItem> shopcar = (List<CartItem>)session.getAttribute("shopcar"); 
					 		float total = 0f;
					 		for(CartItem item : shopcar){
					 		 
					 			if(item != null){
					 				total += item.getTotal(); 
					 %>						
					<tr id="c2">
						<td>
							<img class="shoes"src="images/<%=item.getProduct().getPic() %>"/>
						</td>
						<td><%=item.getProduct().getProductname() %></td>
						<td><%=item.getProduct().getCode() %></td>
						<td><%=item.getProduct().getSize() %></td>
						<td><%=item.getProduct().getColor() %></td>
						<td class="price" ><%=item.getProduct().getPrice() %></td>
						<td class="num" ><%=item.getNum()%></td>
						<td class="price" ><%=item.getTotal()%></td>
					</tr>
					<%}} %>
					<!--  
					<tr id="c1">
						<th>缩略图</th>
						<th style="width:375px;height:18px">商品名</th>
						<th style="width:110px;height:18px;">货号</th>
						<th style="width:50px">尺码</th>
						<th style="width:50px">颜色</th>
						<th style="width:70px">单价</th>
						<th style="width:50px">数量</th>
						<th style="width:110px">小计</th>
						<th style="width:9px"></th>
					</tr>						
					<tr id="c2">
						<td>
							<img src="images/11e101812.jpg"/>
						</td>
						<td>达芙妮甜蜜糖果-靓丽圆头楔跟单鞋</td>
						<td>11E101812</td>
						<td>34</td>
						<td>粉红色</td>
						<td class="price" >159.00</td>
						<td>1</td>
						<td class="price" >159.00</td>
						<td></td>
					</tr>
					<tr id="c3">
						<td>
							<img style="height:90px;width:90px" src="images/11e300415.jpg"/>
						</td>
						<td>达芙妮魅力优雅－真皮镂空扣饰高跟凉鞋</td>
						<td>11E300415</td>
						<td>35</td>
						<td>黑色</td>
						<td class="price" >299.00</td>
						<td>1</td>
						<td class="price" >299.00</td>
						<td></td>
					</tr>
					-->
				</table>
				<p class="price">
					运费：0.00
					<br/>合计：<%=total%>&nbsp;&nbsp;&nbsp;&nbsp;
					<br/>您选择的优惠方式是：会员等级优惠普通会员&nbsp;&nbsp;&nbsp;-0.00
					<br/>可获积分：<%=total%>点 实付款：<%=total%>元
				</p>
			</div>
			<div style="height:100px">
				<a href="cart.jsp"><input id="button1" type="button" /></a>
				<a href="javascript:submitform()" style="width:113px;height:45px;"><input id="button2" type="button"></a>
			</div>
			</form>
		</div>
		<div id="footer">
			<img src="images/tel.jpg" style="float:right"/>
			<img src="images/footer.PNG" style="margin-top:10px;"/>
			<div class="footerf">
				<img src="images/foot-logo.jpg" style="float:right"/>	
			</div>
			<div style="margin-top:27px;float:right">
				<img src="images/oo.PNG" style="float:right"/>
			</div>
		</div>
	</body>
</html>